import { createRouter, createWebHashHistory } from 'vue-router'
// createWebHistory
// 1. 配置路由
const routes = [
  {
    path: '/', // 默认路由 home页面
    component: () => import('../views/Home.vue')
  },
  {
    path: '/settings', // 设置页面
    component: () => import('../views/Settings.vue')
  },
  {
    path: '/controlEdit', // 程控设置
    component: () => import('../views/ControlEdit.vue')
  },
  {
    path: '/control', // 程控设置
    component: () => import('../views/Control.vue')
  },
  {
    path: '/airConditioner', // 空调机组设置
    component: () => import('../views/AirConditioner.vue')
  },
  {
    path: '/auxiliary', // 辅助功能
    component: () => import('../views/Auxiliary.vue')
  },
  {
    path: '/time', // 运行时间
    component: () => import('../views/Time.vue')
  },
  {
    path: '/fault', // 故障提醒
    component: () => import('../views/Fault.vue')
  },
  {
    path: '/clock', // 时钟设置
    component: () => import('../views/Clock.vue')
  },
  {
    path: '/guide', // 操作指南
    component: () => import('../views/Guide.vue')
  },
  {
    path: '/shopping', // 购物
    component: () => import('../views/Shopping.vue')
  },
  {
    path: '/machine', // 购物
    component: () => import('../views/MachineWork.vue')
  }
]
// 2.返回一个 router 实列，为函数，配置 history 模式
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes
})

// 3.导出路由   去 main.ts 注册 router.ts
export default router
